package com.chainyoung.component_tmtrade.ui.mvp.model;


import com.chainyoung.common.appcommon.entity.CommonList;
import com.chainyoung.common.di.scope.FragmentScope;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmtrade.api.TradeService;
import com.chainyoung.component_tmtrade.bean.MyBanlance;
import com.chainyoung.component_tmtrade.bean.TradeCurrencyItem;
import com.chainyoung.component_tmtrade.ui.mvp.contract.TradeCurrencyBuyContract;
import com.chainyoung.component_tmtrade.ui.mvp.contract.TradeCurrencyListContract;

import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

@FragmentScope
public class TradeCurrencyListModel extends BaseModel implements TradeCurrencyListContract.Model {

    @Inject
    TradeCurrencyListModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);

    }


    @Override
    public Flowable<CommonList<TradeCurrencyItem>> getExchangeTradeList(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(TradeService.class)
                .getExchangeTradeList(map)
                .compose(RxUtils.<CommonList<TradeCurrencyItem>>handleResult());
    }


}
